﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace utils
{
    /// <summary>
    /// json数据类
    /// </summary>
    public class JsonResults
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public int code { get; set; }

        /// <summary>
        /// 异常或成功信息
        /// </summary>
        public string msg { get; set; }
        public int count { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public object data { get; set; }

        /// <summary>
        /// 返回json数据
        /// </summary>
        /// <param name="code">状态码</param>
        /// <param name="msg">状态信息</param>
        /// <param name="count">总数</param>
        /// <param name="data">数据</param>
        public JsonResults(int code, string msg, int count, object data)
        {
            this.code = code;
            this.msg = msg;
            this.count = count;
            this.data = data;
        }

        /// <summary>
        /// 返回json数据
        /// </summary>
        /// <param name="code">状态码</param>
        /// <param name="msg">状态信息</param>
        /// <param name="data">数据</param>
        public JsonResults(int code, string msg, object data)
        {
            this.code = code;
            this.msg = msg;
            this.data = data;
        }

        public JsonResults(int code, string msg)
        {
            this.code = code;
            this.msg = msg;
        }

        public JsonResults()
        {

        }

       

    }
}
